const { list } = require('./data/lucky-money')
const base = '/operation'
let switchStatus = 'on'
module.exports = [{
  url: `${base}/luckyMoney/returnMoney`,
  type: 'get',
  response: config => {
    return { success: true, data: switchStatus, message: '查询失败' }
  }
}, {
  url: `${base}/luckyMoney`,
  type: 'get',
  response: config => {
    const { page, limit, orgUnitId, roomId } = config.query
    return list(page, limit, orgUnitId, roomId)
  }
}, {
  url: `${base}/luckyMoney/returnMoney/on`,
  type: 'put',
  response: config => {
    switchStatus = 'on'
    return { success: true }
  }
}, {
  url: `${base}/luckyMoney/returnMoney/off`,
  type: 'put',
  response: config => {
    switchStatus = 'off'
    return { success: true }
  }
}]
